from django import forms
from django.core.exceptions import ValidationError

from . import models


class TitleForm(forms.ModelForm):
    class Meta:
        model = models.Title
        fields = ['title']
        labels = {'title': ' '}


class ContentForm(forms.ModelForm):
    class Meta:
        model = models.Content
        fields = ['text']


class UserForm(forms.ModelForm):
    # repassword = forms.CharField(label='重复密码', widget=forms.PasswordInput())
    # password = forms.CharField(label='密码', widget=forms.PasswordInput())
    class Meta:
        model = models.MyUser
        fields = ['username', 'password']



